package com.itrus.raapi.dictionary;

import java.io.InputStream;
import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class ICADictionary
{
  private static Properties errorDictionary = new Properties();
  private static boolean init = false;

  private void initDictionary()
  {
    while (true)
    {
      NodeList localNodeList;
      int i;
      try
      {
        InputStream localInputStream = getClass().getResourceAsStream("/com/itrus/raapi/dictionary/ICADictionary.xml");
        DocumentBuilderFactory localDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
        try
        {
          Document localDocument2 = localDocumentBuilderFactory.newDocumentBuilder().parse(localInputStream);
          localDocument1 = localDocument2;
          localNodeList = localDocument1.getElementsByTagName("param");
          i = 0;
          if (i >= localNodeList.getLength())
          {
            init = true;
            return;
          }
        }
        catch (Exception localException)
        {
          localException.printStackTrace();
          Document localDocument1 = null;
          continue;
        }
      }
      finally
      {
      }
      Element localElement = (Element)localNodeList.item(i);
      String str1 = localElement.getAttribute("name");
      String str2 = localElement.getAttribute("value");
      errorDictionary.setProperty(str1, str2);
      i++;
    }
  }

  public String getHexCode(long paramLong)
  {
    if (paramLong < 0L)
      paramLong &= 65535L;
    return Long.toHexString(paramLong).toUpperCase();
  }

  public long getLongCode(String paramString)
  {
    return -(0xFFFF & -Long.valueOf(paramString, 16).longValue());
  }

  public String getMessage(long paramLong)
  {
    if (!init)
      initDictionary();
    if (paramLong < 0L)
      paramLong &= 65535L;
    return getMessage(Long.toHexString(paramLong).toUpperCase());
  }

  public String getMessage(String paramString)
  {
    if (!init)
      initDictionary();
    String str = errorDictionary.getProperty(paramString.toUpperCase());
    if (str == null)
      str = "未指定错误";
    return str;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.itrus.raapi.dictionary.ICADictionary
 * JD-Core Version:    0.6.2
 */